Create monorepo and typeScript react base project#36
Create monorepo and typeScript react base project#36ricardozanini merged 49 commits intoserverlessworkflow:mainfrom
Conversation
8a9c9fe to
02fcc14
Compare
There was a problem hiding this comment.
Pull request overview
This PR bootstraps a pnpm-based monorepo for the Serverless Workflow Visual Editor, adding a shared ESLint/Prettier setup and an initial TypeScript + React package (serverless-workflow-diagram-editor) with Storybook, placeholder UI, and basic test scaffolding.
Changes:
- Add monorepo workspace configuration, shared TypeScript configs, and root-level tooling (ESLint/Prettier/pnpm).
- Introduce a shared
@serverless-workflow-settings/eslint-configpackage and apply it at the repo root and in the diagram editor package. - Create the
serverless-workflow-diagram-editorpackage with Storybook stories/assets and an initial PatternFly-basedDiagramEditorplaceholder component.
Reviewed changes
Copilot reviewed 37 out of 58 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.test.json | Adds a dedicated tsconfig for tests (jest/testing-library types, noEmit). |
| tsconfig.base.json | Introduces shared TS compiler defaults for packages. |
| pnpm-workspace.yaml | Defines workspace packages and build dependency allowlist. |
| packages/serverless-workflow-diagram-editor/tsconfig.json | Package TS build config (src → dist). |
| packages/serverless-workflow-diagram-editor/tests/setupTests.ts | Jest DOM setup entry for tests. |
| packages/serverless-workflow-diagram-editor/tests/react-flow/Sample.test.tsx | Adds placeholder test file for react-flow area. |
| packages/serverless-workflow-diagram-editor/tests/core/sample.test.ts | Adds placeholder test file for core area. |
| packages/serverless-workflow-diagram-editor/stories/page.css | Storybook example styles for Page. |
| packages/serverless-workflow-diagram-editor/stories/header.css | Storybook example styles for Header. |
| packages/serverless-workflow-diagram-editor/stories/button.css | Storybook example styles for Button. |
| packages/serverless-workflow-diagram-editor/stories/assets/youtube.svg | Adds Storybook example asset. |
| packages/serverless-workflow-diagram-editor/stories/assets/tutorials.svg | Adds Storybook example asset. |
| packages/serverless-workflow-diagram-editor/stories/assets/styling.png | Adds Storybook example asset. |
| packages/serverless-workflow-diagram-editor/stories/assets/share.png | Adds Storybook example asset. |
| packages/serverless-workflow-diagram-editor/stories/assets/github.svg | Adds Storybook example asset. |
| packages/serverless-workflow-diagram-editor/stories/assets/docs.png | Adds Storybook example asset. |
| packages/serverless-workflow-diagram-editor/stories/assets/discord.svg | Adds Storybook example asset. |
| packages/serverless-workflow-diagram-editor/stories/assets/context.png | Adds Storybook example asset. |
| packages/serverless-workflow-diagram-editor/stories/assets/avif-test-image.avif | Adds Storybook asset used for media handling examples. |
| packages/serverless-workflow-diagram-editor/stories/assets/assets.png | Adds Storybook example asset. |
| packages/serverless-workflow-diagram-editor/stories/assets/accessibility.svg | Adds Storybook example asset. |
| packages/serverless-workflow-diagram-editor/stories/Page.tsx | Adds Storybook example Page component. |
| packages/serverless-workflow-diagram-editor/stories/Page.stories.ts | Adds Storybook stories + interaction test for Page. |
| packages/serverless-workflow-diagram-editor/stories/Header.tsx | Adds Storybook example Header component. |
| packages/serverless-workflow-diagram-editor/stories/Header.stories.ts | Adds Storybook stories for Header. |
| packages/serverless-workflow-diagram-editor/stories/DiagramEditor.tsx | Adds Storybook wrapper around the package’s DiagramEditor component. |
| packages/serverless-workflow-diagram-editor/stories/DiagramEditor.stories.ts | Adds the initial DiagramEditor story. |
| packages/serverless-workflow-diagram-editor/stories/Configure.mdx | Adds Storybook configuration/learning MDX page and related UI. |
| packages/serverless-workflow-diagram-editor/stories/Button.tsx | Adds Storybook example Button component. |
| packages/serverless-workflow-diagram-editor/stories/Button.stories.ts | Adds Storybook stories for Button. |
| packages/serverless-workflow-diagram-editor/src/react-flow/README.md | Adds placeholder docs for the react-flow sub-area. |
| packages/serverless-workflow-diagram-editor/src/index.ts | Adds package export barrel. |
| packages/serverless-workflow-diagram-editor/src/diagram-editor/index.ts | Adds diagram-editor export barrel. |
| packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx | Adds initial DiagramEditor placeholder implementation using PatternFly components. |
| packages/serverless-workflow-diagram-editor/src/core/README.md | Adds placeholder docs for core sub-area. |
| packages/serverless-workflow-diagram-editor/package.json | Adds package scripts (build/test/storybook), deps/devDeps. |
| packages/serverless-workflow-diagram-editor/eslint.config.js | Applies shared ESLint flat config to the package. |
| packages/serverless-workflow-diagram-editor/README.md | Adds package-level build/run instructions. |
| packages/serverless-workflow-diagram-editor/.storybook/preview.ts | Adds Storybook preview configuration (controls matchers). |
| packages/serverless-workflow-diagram-editor/.storybook/main.ts | Adds Storybook main config (addons, stories glob, telemetry off). |
| packages/eslint-config/package.json | Adds a shared ESLint config package definition. |
| packages/eslint-config/index.js | Implements shared ESLint flat config (TS/React/Prettier/hooks + ignores). |
| package.json | Adds root scripts and pins engines/pnpm for the monorepo. |
| eslint.config.js | Applies shared ESLint flat config at repo root. |
| README.md | Adds monorepo prerequisites and build instructions. |
| LICENSE | Fixes formatting/line-numbering at file end. |
| GOVERNANCE.md | Fixes formatting/line-numbering at file end. |
| CONTRIBUTING.md | Updates build instructions to pnpm and updates new-package script naming. |
| CODE_OF_CONDUCT.md | Fixes formatting/line-numbering at file end. |
| .prettierrc | Adds Prettier configuration. |
| .npmrc | Adds npm config to ignore workspace root check. |
| .gitignore | Adds/extends ignore patterns for node/dist/storybook artifacts and IDE files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx
Outdated
Show resolved
Hide resolved
packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx
Outdated
Show resolved
Hide resolved
packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx
Outdated
Show resolved
Hide resolved
packages/serverless-workflow-diagram-editor/stories/DiagramEditor.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 38 out of 59 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx
Outdated
Show resolved
Hide resolved
26672a7 to
17e73b3
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 41 out of 62 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/serverless-workflow-diagram-editor/tests/diagram-editor/DiagramEditor.test.tsx
Show resolved
Hide resolved
packages/serverless-workflow-diagram-editor/tests/diagram-editor/DiagramEditor.test.tsx
Outdated
Show resolved
Hide resolved
1e26a38 to
f2082d3
Compare
|
@fantonangeli , @lornakelly , @ricardozanini @JBBianchi; This PR is good enough for human review! Thanks! |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 43 out of 64 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/serverless-workflow-diagram-editor/tests/diagram-editor/DiagramEditor.test.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 43 out of 64 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/serverless-workflow-diagram-editor/tests/diagram-editor/DiagramEditor.test.tsx
Outdated
Show resolved
Hide resolved
15daf31 to
d9ef232
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 43 out of 64 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/serverless-workflow-diagram-editor/tests/diagram-editor/DiagramEditor.test.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: fantonangeli <fabrizio.antonangeli@gmail.com> Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: fantonangeli <fabrizio.antonangeli@gmail.com> Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: fantonangeli <fabrizio.antonangeli@gmail.com> Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: fantonangeli <fabrizio.antonangeli@gmail.com> Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: fantonangeli <fabrizio.antonangeli@gmail.com> Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: fantonangeli <fabrizio.antonangeli@gmail.com> Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: fantonangeli <fabrizio.antonangeli@gmail.com> Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: fantonangeli <fabrizio.antonangeli@gmail.com> Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Fabrizio Antonangeli fabrizio.antonangeli@gmail.com Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: fantonangeli <fabrizio.antonangeli@gmail.com> Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: fantonangeli <fabrizio.antonangeli@gmail.com> Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: fantonangeli <fabrizio.antonangeli@gmail.com> Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
| "husky": "catalog:", | ||
| "lint-staged": "catalog:", | ||
| "oxfmt": "catalog:", | ||
| "syncpack": "catalog:", |
There was a problem hiding this comment.
Not sure we need syncpack right now? Considering its a new, small repo and that we now have pnpm catalogs I think we could leave syncpack out and add it in the future if we really see a need?
Considering pnpm catalogs gives us shared versions for the repo I think it will be much easier to manage, what do you think?
There was a problem hiding this comment.
I agree catalogs are a great default and probably enough for now.
The only concern I have is that they don’t enforce usage. Someone could still accidentally install a different version instead of using "catalog:", especially as we add more packages.
That’s where syncpack could help as a lightweight safety net (e.g. catching mismatches in CI).
That said, I’m also fine keeping things simple for now and adding it later if we start seeing that kind of drift, I just wanted to call out the tradeoff.
There was a problem hiding this comment.
It wasn't added in this PR, I only updated the settings to match the catalog approach.
#44
To not mix things, I recommend removing it in other PR if that's the case.
There was a problem hiding this comment.
Im happy to leave in, im new to pnpm catalogs (very nice by the way) but its good to stay safe based on above. Thanks for the input!
There was a problem hiding this comment.
@handreyrc @JBBianchi @lornakelly
Sorry for the late reply, but I think it is worth explaining why I introduced Syncpack and what advantages it brings:
- We can configure and enforce dependency policies. See: https://github.com/serverlessworkflow/editor/blob/main/.syncpackrc.json
pnpm catalogsdon't check and enforce the use of catalogs- It enforces the use of
workspace:*between monorepo packages, like I did here:Line 8 in c57b6c3
This avoids accidentally using a pinned version from npm registry instead - It can explicitly target and enforce rules on
peerDependencies, also configured here. - Show custom validation messages, which are useful for new contributors
Having two different versions of the same dependency across two packages, even if they differ only by a patch version, can lead to strange behaviour and can be difficult to debug. I remember this happened to the team and me before in another pnpm monorepo.
On the other hand, this does not increase the bundle size, and it is a very quick check in CI.
Please feel free to share your viewpoint on these points.
There was a problem hiding this comment.
Thanks for the additional info Fabrizio!
Closes #8
Closes #14
This PR aims to: